<?php require_once('header.php'); ?>
<?php //include_once('topwidget.php'); ?>

<div id="contentBox">
<?php include_once('sidebar.php'); ?>

<div id="content">
<h1>All Projects</h1>
<?php
	$allprjquery = "SELECT * FROM projects, subcategories WHERE psubcatid=scid";
	connection();
	$projects = mysql_query($allprjquery);
	
	while($project = mysql_fetch_array($projects)) {
?>
    <div class="box">
    <h3><a href="project.php?prjid=<?php echo $project['pid']; ?>"><?php echo $project['ptitle']; ?></a>
    <span class="posted">Est. Budget: $<?php echo $project['pbudget']; ?></span>
    </h3>
        <p><?php echo $project['pdescription']; ?></p>
        <span class="applybtn"><a href="project.php?prjid=<?php echo $project['pid']; ?>">Apply</a></span>
		<span class="categoryBtn"><?php echo $project['cname']; ?></span>
        <span class="categoryBtn">Posted: <?php echo $project['pposteddate']; ?></span>
        <span class="categoryBtn">End Date: <?php echo $project['penddate']; ?></span>
    </div>
<?php
	}
?>

</div>
<div style="clear:both;"></div>

<?php //include_once('bottomwidget.php'); ?>
<?php include_once('footer.php'); ?>